/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanelMiperfil.java
 *
 * Created on 26/05/2011, 06:23:56 PM
 */
package gui;
import controlador.*;
import logica.*;
import java.util.*;
import javax.swing.*;

/**
 *
 * @author Gamboa Family
 */
public class PanelMiperfil extends javax.swing.JPanel {
    String fechaNacimiento="",dia="",mes="",anio="",genero="",nivelEscolaridad="",
           vinculo_UV="",contrasenaVerificacion="",tipo_usuario="",
           preguntaSecreta = "", mensaje, codigo;
    AddAreasMaterial dialogoAgregarAreas;
    ControladorUsuario control = new ControladorUsuario();
    Usuario usuario;
    String lista28Dias[], lista30Dias[], lista31Dias[];
    /** Creates new form PanelMiperfil */
    public PanelMiperfil(String cod_usuario) {
        initComponents();
        this.codigo = cod_usuario;
        usuario = control.retornarUsuarioPorCodigo(codigo);        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel35 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jLabel37 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jTFRespuesta1 = new javax.swing.JTextField();
        jCBPregunta1 = new javax.swing.JComboBox();
        jBGuardar2 = new javax.swing.JButton();
        jBModificar2 = new javax.swing.JButton();
        jBCancelar2 = new javax.swing.JButton();
        jPFContrasena2 = new javax.swing.JPasswordField();
        jLabel53 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        jLabel48 = new javax.swing.JLabel();
        jPFVContrasena1 = new javax.swing.JPasswordField();
        jPFNuevaContrasena1 = new javax.swing.JPasswordField();
        jLabel51 = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        jPFContrasenaActual1 = new javax.swing.JPasswordField();
        jBModificar3 = new javax.swing.JButton();
        jBGuardar3 = new javax.swing.JButton();
        jBCancelar3 = new javax.swing.JButton();
        jPanel13 = new javax.swing.JPanel();
        jLabel39 = new javax.swing.JLabel();
        jTFNombres1 = new javax.swing.JTextField();
        jLabel40 = new javax.swing.JLabel();
        jTFApellidos1 = new javax.swing.JTextField();
        jLabel41 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jCBGenero1 = new javax.swing.JComboBox();
        jTFCorreo1 = new javax.swing.JTextField();
        jLabel44 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jCBVinculo1 = new javax.swing.JComboBox();
        jLabel46 = new javax.swing.JLabel();
        jCBNivelEscolaridad1 = new javax.swing.JComboBox();
        jCBDia1 = new javax.swing.JComboBox();
        jCBMes1 = new javax.swing.JComboBox();
        jCBAnio1 = new javax.swing.JComboBox();
        jBAreasInteres = new javax.swing.JButton();
        jBGuardar1 = new javax.swing.JButton();
        jBModificar1 = new javax.swing.JButton();
        jBCancelar1 = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));

        jLabel35.setBackground(new java.awt.Color(255, 255, 255));
        jLabel35.setFont(new java.awt.Font("Verdana", 1, 22));
        jLabel35.setForeground(new java.awt.Color(235, 30, 30));
        jLabel35.setText("Gestión de Información Personal - Áreas de Interés");

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        jPanel12.setBackground(new java.awt.Color(255, 255, 255));
        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Pregunta Secreta", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14), new java.awt.Color(235, 30, 30))); // NOI18N

        jLabel37.setBackground(new java.awt.Color(255, 255, 255));
        jLabel37.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel37.setForeground(new java.awt.Color(130, 134, 135));
        jLabel37.setText("Pregunta secreta");

        jLabel47.setBackground(new java.awt.Color(255, 255, 255));
        jLabel47.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel47.setForeground(new java.awt.Color(130, 134, 135));
        jLabel47.setText("Respuesta secreta");

        jTFRespuesta1.setFont(new java.awt.Font("Verdana", 0, 12));

        jCBPregunta1.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        jCBPregunta1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escoja:", "¿Como se llama su mascota?", "¿Cual es su escritor favorito?", "¿A que jardin infantil asistio usted?", "¿Cual es su lugar favorito?", "¿Donde nacio su madre?", "¿Cual es su color favorito?", "¿Como se llama su mascota?", "¿Cual es su escritor favorito?", "¿A que jardin infantil asistio usted?", "¿Cual es su lugar favorito?", "¿Donde nacio su madre?", "¿Cual es su color favorito?" }));
        jCBPregunta1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jCBPregunta1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBPregunta1ItemStateChanged(evt);
            }
        });
        jCBPregunta1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBPregunta1ActionPerformed(evt);
            }
        });

        jBGuardar2.setBackground(new java.awt.Color(255, 255, 255));
        jBGuardar2.setFont(new java.awt.Font("Verdana", 1, 12));
        jBGuardar2.setForeground(new java.awt.Color(235, 30, 30));
        jBGuardar2.setText("Guardar");
        jBGuardar2.setEnabled(false);
        jBGuardar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBGuardar2ActionPerformed(evt);
            }
        });

        jBModificar2.setBackground(new java.awt.Color(255, 255, 255));
        jBModificar2.setFont(new java.awt.Font("Verdana", 1, 12));
        jBModificar2.setForeground(new java.awt.Color(235, 30, 30));
        jBModificar2.setText("Modificar");
        jBModificar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBModificar2ActionPerformed(evt);
            }
        });

        jBCancelar2.setBackground(new java.awt.Color(255, 255, 255));
        jBCancelar2.setFont(new java.awt.Font("Verdana", 1, 12));
        jBCancelar2.setForeground(new java.awt.Color(235, 30, 30));
        jBCancelar2.setText("Cancelar");
        jBCancelar2.setEnabled(false);
        jBCancelar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelar2ActionPerformed(evt);
            }
        });

        jPFContrasena2.setFont(new java.awt.Font("Verdana", 0, 12));
        jPFContrasena2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPFContrasena2ActionPerformed(evt);
            }
        });

        jLabel53.setBackground(new java.awt.Color(255, 255, 255));
        jLabel53.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel53.setForeground(new java.awt.Color(130, 134, 135));
        jLabel53.setText("Contraseña");

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel53)
                            .addComponent(jLabel37)
                            .addComponent(jLabel47))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jCBPregunta1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPFContrasena2, javax.swing.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE)
                            .addComponent(jTFRespuesta1)))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGap(57, 57, 57)
                        .addComponent(jBModificar2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBGuardar2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jBCancelar2)))
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jPFContrasena2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel53))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCBPregunta1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel37))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTFRespuesta1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel47))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBModificar2)
                    .addComponent(jBGuardar2)
                    .addComponent(jBCancelar2))
                .addContainerGap())
        );

        jPanel15.setBackground(new java.awt.Color(255, 255, 255));
        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Contraseña", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14), new java.awt.Color(235, 30, 30))); // NOI18N

        jLabel48.setBackground(new java.awt.Color(255, 255, 255));
        jLabel48.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel48.setForeground(new java.awt.Color(130, 134, 135));
        jLabel48.setText("Verif. contraseña");

        jPFVContrasena1.setFont(new java.awt.Font("Verdana", 0, 12));

        jPFNuevaContrasena1.setFont(new java.awt.Font("Verdana", 0, 12));
        jPFNuevaContrasena1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPFNuevaContrasena1ActionPerformed(evt);
            }
        });

        jLabel51.setBackground(new java.awt.Color(255, 255, 255));
        jLabel51.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel51.setForeground(new java.awt.Color(130, 134, 135));
        jLabel51.setText("Nueva Contraseña");

        jLabel52.setBackground(new java.awt.Color(255, 255, 255));
        jLabel52.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel52.setForeground(new java.awt.Color(130, 134, 135));
        jLabel52.setText("Contraseña Actual");

        jPFContrasenaActual1.setFont(new java.awt.Font("Verdana", 0, 12));
        jPFContrasenaActual1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPFContrasenaActual1ActionPerformed(evt);
            }
        });

        jBModificar3.setBackground(new java.awt.Color(255, 255, 255));
        jBModificar3.setFont(new java.awt.Font("Verdana", 1, 12));
        jBModificar3.setForeground(new java.awt.Color(235, 30, 30));
        jBModificar3.setText("Modificar");
        jBModificar3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBModificar3ActionPerformed(evt);
            }
        });

        jBGuardar3.setBackground(new java.awt.Color(255, 255, 255));
        jBGuardar3.setFont(new java.awt.Font("Verdana", 1, 12));
        jBGuardar3.setForeground(new java.awt.Color(235, 30, 30));
        jBGuardar3.setText("Guardar");
        jBGuardar3.setEnabled(false);
        jBGuardar3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBGuardar3ActionPerformed(evt);
            }
        });

        jBCancelar3.setBackground(new java.awt.Color(255, 255, 255));
        jBCancelar3.setFont(new java.awt.Font("Verdana", 1, 12));
        jBCancelar3.setForeground(new java.awt.Color(235, 30, 30));
        jBCancelar3.setText("Cancelar");
        jBCancelar3.setEnabled(false);
        jBCancelar3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelar3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel15Layout.createSequentialGroup()
                                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel48)
                                    .addComponent(jLabel51))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jPFVContrasena1, javax.swing.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE)
                                    .addComponent(jPFNuevaContrasena1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE)))
                            .addGroup(jPanel15Layout.createSequentialGroup()
                                .addComponent(jLabel52)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPFContrasenaActual1, javax.swing.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                        .addComponent(jBModificar3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBGuardar3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jBCancelar3)
                        .addGap(58, 58, 58))))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                .addContainerGap(20, Short.MAX_VALUE)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jPFContrasenaActual1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel52))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jPFNuevaContrasena1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel51))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jPFVContrasena1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel48))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBModificar3)
                    .addComponent(jBGuardar3)
                    .addComponent(jBCancelar3))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel13.setBackground(new java.awt.Color(255, 255, 255));
        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Información Personal", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14), new java.awt.Color(235, 30, 30))); // NOI18N

        jLabel39.setBackground(new java.awt.Color(255, 255, 255));
        jLabel39.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel39.setForeground(new java.awt.Color(130, 134, 135));
        jLabel39.setText("Nombres");

        jTFNombres1.setFont(new java.awt.Font("Verdana", 0, 12));

        jLabel40.setBackground(new java.awt.Color(255, 255, 255));
        jLabel40.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel40.setForeground(new java.awt.Color(130, 134, 135));
        jLabel40.setText("Apellidos");

        jTFApellidos1.setFont(new java.awt.Font("Verdana", 0, 12));

        jLabel41.setBackground(new java.awt.Color(255, 255, 255));
        jLabel41.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel41.setForeground(new java.awt.Color(130, 134, 135));
        jLabel41.setText("Género");

        jLabel43.setBackground(new java.awt.Color(255, 255, 255));
        jLabel43.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel43.setForeground(new java.awt.Color(130, 134, 135));
        jLabel43.setText("Fecha de Nacimiento");

        jCBGenero1.setFont(new java.awt.Font("Verdana", 0, 12));
        jCBGenero1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escoja:", "F", "M" }));
        jCBGenero1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jCBGenero1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBGenero1ItemStateChanged(evt);
            }
        });
        jCBGenero1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBGenero1ActionPerformed(evt);
            }
        });

        jTFCorreo1.setFont(new java.awt.Font("Verdana", 0, 12));

        jLabel44.setBackground(new java.awt.Color(255, 255, 255));
        jLabel44.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel44.setForeground(new java.awt.Color(130, 134, 135));
        jLabel44.setText("Correo Electrónico");

        jLabel45.setBackground(new java.awt.Color(255, 255, 255));
        jLabel45.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel45.setForeground(new java.awt.Color(130, 134, 135));
        jLabel45.setText("Nivel de escolaridad");

        jCBVinculo1.setFont(new java.awt.Font("Verdana", 0, 12));
        jCBVinculo1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escoja:", "Estud. pregrado", "Estud. postgrado", "Egresado", "Profesor activo", "Jubilado", "Ninguno" }));
        jCBVinculo1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jCBVinculo1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBVinculo1ItemStateChanged(evt);
            }
        });
        jCBVinculo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBVinculo1ActionPerformed(evt);
            }
        });

        jLabel46.setBackground(new java.awt.Color(255, 255, 255));
        jLabel46.setFont(new java.awt.Font("Verdana", 1, 12));
        jLabel46.setForeground(new java.awt.Color(130, 134, 135));
        jLabel46.setText("Vínculo con UniValle");

        jCBNivelEscolaridad1.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        jCBNivelEscolaridad1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escoja:", "Basica primaria", "Basica secundaria", "Bachiller academico", "Nivel Tecnico", "Nivel Tecnologo", "Estudiante universitario", "Profesional" }));
        jCBNivelEscolaridad1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jCBNivelEscolaridad1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBNivelEscolaridad1ItemStateChanged(evt);
            }
        });
        jCBNivelEscolaridad1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBNivelEscolaridad1ActionPerformed(evt);
            }
        });

        jCBDia1.setFont(new java.awt.Font("Verdana", 0, 12));
        jCBDia1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBDia1ItemStateChanged(evt);
            }
        });
        jCBDia1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBDia1ActionPerformed(evt);
            }
        });

        jCBMes1.setFont(new java.awt.Font("Verdana", 0, 12));
        jCBMes1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mes:", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));
        jCBMes1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBMes1ItemStateChanged(evt);
            }
        });

        jCBAnio1.setFont(new java.awt.Font("Verdana", 0, 12));
        jCBAnio1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Año:", "1950", "1951", "1952", "1953", "1954", "1955", "1956", "1957", "1958", "1959", "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970", "1971", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983", "1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000" }));
        jCBAnio1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jCBAnio1ItemStateChanged(evt);
            }
        });
        jCBAnio1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBAnio1ActionPerformed(evt);
            }
        });

        jBAreasInteres.setBackground(new java.awt.Color(255, 255, 255));
        jBAreasInteres.setFont(new java.awt.Font("Verdana", 1, 12));
        jBAreasInteres.setForeground(new java.awt.Color(235, 30, 30));
        jBAreasInteres.setText("Agregar o Quitar Areas de Interes");
        jBAreasInteres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAreasInteresActionPerformed(evt);
            }
        });

        jBGuardar1.setBackground(new java.awt.Color(255, 255, 255));
        jBGuardar1.setFont(new java.awt.Font("Verdana", 1, 12));
        jBGuardar1.setForeground(new java.awt.Color(235, 30, 30));
        jBGuardar1.setText("Guardar");
        jBGuardar1.setEnabled(false);
        jBGuardar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBGuardar1ActionPerformed(evt);
            }
        });

        jBModificar1.setBackground(new java.awt.Color(255, 255, 255));
        jBModificar1.setFont(new java.awt.Font("Verdana", 1, 12));
        jBModificar1.setForeground(new java.awt.Color(235, 30, 30));
        jBModificar1.setText("Modificar");
        jBModificar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBModificar1ActionPerformed(evt);
            }
        });

        jBCancelar1.setBackground(new java.awt.Color(255, 255, 255));
        jBCancelar1.setFont(new java.awt.Font("Verdana", 1, 12));
        jBCancelar1.setForeground(new java.awt.Color(235, 30, 30));
        jBCancelar1.setText("Cancelar");
        jBCancelar1.setEnabled(false);
        jBCancelar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelar1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel41)
                            .addComponent(jLabel43)
                            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel39, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel40, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTFNombres1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
                            .addComponent(jTFApellidos1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
                            .addGroup(jPanel13Layout.createSequentialGroup()
                                .addComponent(jCBAnio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jCBMes1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jCBDia1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jCBGenero1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jBAreasInteres))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel13Layout.createSequentialGroup()
                                .addGap(25, 25, 25)
                                .addComponent(jLabel44))
                            .addGroup(jPanel13Layout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel46)
                                    .addComponent(jLabel45))))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCBVinculo1, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jCBNivelEscolaridad1, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTFCorreo1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE))))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addContainerGap(64, Short.MAX_VALUE)
                .addComponent(jBModificar1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBGuardar1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBCancelar1)
                .addGap(72, 72, 72))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel39)
                    .addComponent(jTFNombres1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel40)
                    .addComponent(jTFApellidos1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel41)
                    .addComponent(jCBGenero1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel43)
                    .addComponent(jCBMes1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCBAnio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCBDia1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTFCorreo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel44))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel45)
                    .addComponent(jCBNivelEscolaridad1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel46)
                    .addComponent(jCBVinculo1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBGuardar1)
                    .addComponent(jBModificar1)
                    .addComponent(jBCancelar1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
                .addComponent(jBAreasInteres)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(133, 133, 133)
                .addComponent(jLabel35)
                .addContainerGap(93, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel35)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jCBGenero1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBGenero1ItemStateChanged
        // TODO add your handling code here:
        genero = String.valueOf(jCBGenero1.getSelectedItem());
}//GEN-LAST:event_jCBGenero1ItemStateChanged

    private void jCBGenero1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBGenero1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jCBGenero1ActionPerformed

    private void jCBVinculo1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBVinculo1ItemStateChanged
        // TODO add your handling code here:
        vinculo_UV = String.valueOf(jCBVinculo1.getSelectedItem());
}//GEN-LAST:event_jCBVinculo1ItemStateChanged

    private void jCBVinculo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBVinculo1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jCBVinculo1ActionPerformed

    private void jCBNivelEscolaridad1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBNivelEscolaridad1ItemStateChanged
        // TODO add your handling code here:
        nivelEscolaridad = String.valueOf(jCBNivelEscolaridad1.getSelectedItem());
}//GEN-LAST:event_jCBNivelEscolaridad1ItemStateChanged

    private void jCBNivelEscolaridad1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBNivelEscolaridad1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jCBNivelEscolaridad1ActionPerformed

    private void jCBDia1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBDia1ItemStateChanged
        // TODO add your handling code here:
        dia = String.valueOf(jCBDia1.getSelectedItem());
}//GEN-LAST:event_jCBDia1ItemStateChanged

    private void jCBDia1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBDia1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jCBDia1ActionPerformed

    private void jCBMes1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBMes1ItemStateChanged
        // TODO add your handling code here:
        mes = String.valueOf(jCBMes1.getSelectedItem());
        if(jCBMes1.getSelectedIndex() != 0){
            String lista[] = escogerListaDias(mes);
            jCBDia1.removeAllItems();
            for(int i=0; i<lista.length; i++)
                jCBDia1.addItem(lista[i]);
            jCBDia1.setEnabled(true);
        }         
}//GEN-LAST:event_jCBMes1ItemStateChanged

    private void jCBAnio1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBAnio1ItemStateChanged
        // TODO add your handling code here:
        anio = String.valueOf(jCBAnio1.getSelectedItem());
}//GEN-LAST:event_jCBAnio1ItemStateChanged

    private void jBAreasInteresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAreasInteresActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:
        if(dialogoAgregarAreas == null){
            dialogoAgregarAreas = new AddAreasMaterial(null, true);
            dialogoAgregarAreas.setCaso(4);
            dialogoAgregarAreas.setVisible(true);
        } else
            dialogoAgregarAreas.setVisible(true);
}//GEN-LAST:event_jBAreasInteresActionPerformed

    private void jBGuardar3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGuardar3ActionPerformed
        // TODO add your handling code here:
        if(camposAbajoValidos()){
            String contrasena  = jPFNuevaContrasena1.getText();   
            if(!contrasena.equals(usuario.getContrasena())){
                control.modificarUsuario(7, codigo, contrasena);
                
                JOptionPane.showMessageDialog(this, "La contraseña se modificó "
                        + "con éxito.");                 
                jBModificar3.setEnabled(true);
                jBGuardar3.setEnabled(false);
                jBCancelar3.setEnabled(false);
                usuario = control.retornarUsuarioPorCodigo(codigo);
                activarCamposAbajo(false);
            }
            else
                JOptionPane.showMessageDialog(this, "La contraseña no se modifcó "
                        + "es probable que haya ingresado la misma \ncontraseña, "
                        + "intente de nuevo o presione el botón Cancelar.");  
            
        }
        else{
            JOptionPane.showMessageDialog(this, mensaje, "Error de Modificaión",
                    JOptionPane.ERROR_MESSAGE);
        }  
    }//GEN-LAST:event_jBGuardar3ActionPerformed

    private void jBGuardar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGuardar1ActionPerformed
        // TODO add your handling code here:
        String salida= "";
        if(camposArribaValidos()){
            String nombres  = jTFNombres1.getText();
            String apellidos = jTFApellidos1.getText();
            String fecha_nacimiento = anio + "-" + mes + "-" + dia;
            String correo = jTFCorreo1.getText();            
            if(!nombres.equals(usuario.getNombre())){
                salida+="NOMBRES:    " + usuario.getNombre() + 
                        "    ---->    " + nombres + "\n";
                control.modificarUsuario(1, codigo, nombres);
            }
            if(!apellidos.equals(usuario.getApellido())){                
                salida+="APELLIDOS:    " + usuario.getApellido() + 
                        "    ---->    " + apellidos + "\n";
                control.modificarUsuario(2, codigo, apellidos);
            }
            if(!genero.equals(usuario.getgenero())){
                salida+="GÉNERO:    " + usuario.getgenero() + 
                        "    ---->    " + genero + "\n";
                control.modificarUsuario(3, codigo, genero);               
            }
            if(!fecha_nacimiento.equals(usuario.getFechaDeNacimiento())){
                salida+="FECHA DE NACIMIENTO:    " + usuario.getFechaDeNacimiento() + 
                        "    ---->    " + fecha_nacimiento + "\n";
                control.modificarUsuario(4, codigo, fecha_nacimiento);               
            }
            if(!correo.equals(usuario.getCorreoElectronico())){
                salida+="CORREO ELECTRÓNICO:    " + usuario.getCorreoElectronico() + 
                        "    ---->    " + correo + "\n";
                control.modificarUsuario(12, codigo, correo);               
            }
            if(!nivelEscolaridad.equals(usuario.getNivelEscolaridad())){
                salida+="NIVEL DE ESCOLARIDAD:    " + usuario.getNivelEscolaridad() + 
                        "    ---->    " + nivelEscolaridad + "\n";
                control.modificarUsuario(5, codigo, nivelEscolaridad);               
            }
            if(!vinculo_UV.equals(usuario.getVinculo_UV())){
                salida+="VINCULO CON UNIVALLE:    " + usuario.getVinculo_UV() + 
                        "    ---->    " + vinculo_UV + "\n";
                control.modificarUsuario(6, codigo, vinculo_UV);               
            }
            if(!salida.equals("")) {
                JOptionPane.showMessageDialog(this, "Se hicieron las siguientes "
                        + "modificaciones a su Perfil: \n\n"+ salida);
                activarCamposArriba(false);       
                jBModificar1.setEnabled(true);
                jBGuardar1.setEnabled(false);
                jBCancelar1.setEnabled(false); 
                usuario = control.retornarUsuarioPorCodigo(codigo);
            }
            else
                JOptionPane.showMessageDialog(this, "No se hicieron  modificaciones "
                    + "a su Perfil intente\nde nuevo o presione el botón "
                    + "Cancelar para terminar.");
        }
        else{
            JOptionPane.showMessageDialog(this, mensaje, "Error de Modificaión",
                    JOptionPane.ERROR_MESSAGE);
        }       
    }//GEN-LAST:event_jBGuardar1ActionPerformed

    private void jBModificar3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBModificar3ActionPerformed
        // TODO add your handling code here:
        activarCamposAbajo(true);
        jBModificar3.setEnabled(false);
        jBGuardar3.setEnabled(true);
        jBCancelar3.setEnabled(true);
    }//GEN-LAST:event_jBModificar3ActionPerformed

    private void jBModificar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBModificar1ActionPerformed
        // TODO add your handling code here:
        activarCamposArriba(true);
        jBModificar1.setEnabled(false);
        jBGuardar1.setEnabled(true);
        jBCancelar1.setEnabled(true);
    }//GEN-LAST:event_jBModificar1ActionPerformed

    private void jBCancelar3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelar3ActionPerformed
        // TODO add your handling code here:
        llenarFormulario();
        activarCamposAbajo(false);       
        jBModificar3.setEnabled(true);
        jBGuardar3.setEnabled(false);
        jBCancelar3.setEnabled(false);
    }//GEN-LAST:event_jBCancelar3ActionPerformed

    private void jBCancelar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelar1ActionPerformed
        // TODO add your handling code here:
        llenarFormulario();
        activarCamposArriba(false);       
        jBModificar1.setEnabled(true);
        jBGuardar1.setEnabled(false);
        jBCancelar1.setEnabled(false);
    }//GEN-LAST:event_jBCancelar1ActionPerformed

    private void jCBPregunta1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBPregunta1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jCBPregunta1ActionPerformed

    private void jCBPregunta1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBPregunta1ItemStateChanged
        // TODO add your handling code here:
        preguntaSecreta = String.valueOf(jCBPregunta1.getSelectedItem());
}//GEN-LAST:event_jCBPregunta1ItemStateChanged

    private void jBGuardar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGuardar2ActionPerformed
        // TODO add your handling code here:
        String salida= "";
        if(camposMedioValidos()){
            String respuesta  = jTFRespuesta1.getText();   
            if(!preguntaSecreta.equals(usuario.getPreguntaSecreta())){
                salida+="PREGUNTA SECRETA:    " + usuario.getPreguntaSecreta() + 
                        "    ---->    " + preguntaSecreta + "\n";
                control.modificarUsuario(8, codigo, preguntaSecreta);
            }
            if(!respuesta.equals(usuario.getRespuestaSecreta())){ 
                control.modificarUsuario(9, codigo, respuesta);
            }            
            if(!salida.equals("")) {
                JOptionPane.showMessageDialog(this, "Se le realizó la siguiente "
                        + "modificación a su Perfil: \n\n"+ salida);                       
                jBModificar2.setEnabled(true);
                jBGuardar2.setEnabled(false);
                jBCancelar2.setEnabled(false);
                usuario = control.retornarUsuarioPorCodigo(codigo);  
                activarCamposMedio(false);
            }
            else
                JOptionPane.showMessageDialog(this, "No se hicieron  modificaciones "
                    + "a su Perfil intente de nuevo\no presione el botón "
                    + "Cancelar para terminar.");            
        }
        else{
            JOptionPane.showMessageDialog(this, mensaje, "Error de Modificaión",
                    JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jBGuardar2ActionPerformed

    private void jBModificar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBModificar2ActionPerformed
        // TODO add your handling code here:
        activarCamposMedio(true);       
        jBModificar2.setEnabled(false);
        jBGuardar2.setEnabled(true);
        jBCancelar2.setEnabled(true);
    }//GEN-LAST:event_jBModificar2ActionPerformed

    private void jBCancelar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelar2ActionPerformed
        // TODO add your handling code here:
        llenarFormulario();
        activarCamposMedio(false);       
        jBModificar2.setEnabled(true);
        jBGuardar2.setEnabled(false);
        jBCancelar2.setEnabled(false);
    }//GEN-LAST:event_jBCancelar2ActionPerformed

    private void jPFNuevaContrasena1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPFNuevaContrasena1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jPFNuevaContrasena1ActionPerformed

    private void jPFContrasenaActual1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPFContrasenaActual1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jPFContrasenaActual1ActionPerformed

    private void jPFContrasena2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPFContrasena2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jPFContrasena2ActionPerformed

    private void jCBAnio1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBAnio1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCBAnio1ActionPerformed

    public void llenarFormulario(){        
        jCBPregunta1.setSelectedItem(usuario.getPreguntaSecreta());
        jTFNombres1.setText(usuario.getNombre());
        jTFApellidos1.setText(usuario.getApellido());
        jCBGenero1.setSelectedItem(usuario.getgenero());
        String fecha_nacimiento[] = new String [3];
        StringTokenizer guion  = new StringTokenizer(usuario.getFechaDeNacimiento(), "-");
        for(int i=0; i<3; i++){ 
            if(guion.hasMoreTokens()){
                String aux=guion.nextToken();
                fecha_nacimiento[i]= aux;                    
            }  
        } 
        llenarListasDias();
        jCBAnio1.setSelectedItem(fecha_nacimiento[0]);
        jCBMes1.setSelectedItem(fecha_nacimiento[1]);
        jCBDia1.setSelectedItem(fecha_nacimiento[2]); 
        jTFCorreo1.setText(usuario.getCorreoElectronico());
        jCBNivelEscolaridad1.setSelectedItem(usuario.getNivelEscolaridad());
        jCBVinculo1.setSelectedItem(usuario.getVinculo_UV());
                
        activarCamposArriba(false);
        activarCamposMedio(false);
        activarCamposAbajo(false);
    }
      
    public void activarCamposArriba (Boolean bool){
        jTFNombres1.setEditable(bool);
        jTFApellidos1.setEditable(bool);
        jCBGenero1.setEnabled(bool);
        jCBDia1.setEnabled(bool);          
        jCBMes1.setEnabled(bool);
        jCBAnio1.setEnabled(bool);
        jTFCorreo1.setEditable(bool);
        jCBNivelEscolaridad1.setEnabled(bool);
        jCBVinculo1.setEnabled(bool);
    }
    
    public void activarCamposMedio (Boolean bool){
        jPFContrasena2.setEditable(bool);
        jCBPregunta1.setEnabled(bool);
        jTFRespuesta1.setEditable(bool);
        jPFContrasena2.setText("");
        jTFRespuesta1.setText("");
    }
    
    public void activarCamposAbajo(Boolean bool){
        jPFContrasenaActual1.setEditable(bool);
        jPFNuevaContrasena1.setEditable(bool);
        jPFVContrasena1.setEditable(bool);
        jPFContrasenaActual1.setText("");
        jPFNuevaContrasena1.setText("");
        jPFVContrasena1.setText("");
    }
    
    public Boolean camposArribaValidos(){
        boolean completo = true;                
        mensaje = "Hay errores en la modificación de su Perfil:     " + "\n\n";  
        if(jTFNombres1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Nombres está vacío." + "\n";
        }
        if(jTFApellidos1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Apellidos está vacío." + "\n";
        }        
        if(genero.equals("Escoja:") || genero.equals("")){
            completo = false;
            mensaje += "-> Debe elegir su Género." + "\n";
        }
        if(dia.equals("Dia:") || dia.equals("")){
            completo = false;
            mensaje += "-> Debe elegir un Día para la Fecha de Nacimiento." + "\n";
        }
        if(mes.equals("Mes:") || mes.equals("")){
            completo = false;
            mensaje += "-> Debe elegir un Mes para la Fecha de Nacimiento." + "\n";
        }
        if(anio.equals("Año:") || anio.equals("")){
            completo = false;
            mensaje += "-> Debe elegir un Año para la Fecha de Nacimiento." + "\n";
        }
        if(jTFCorreo1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Correo Electrónico está vacío." + "\n";
        }
        if(nivelEscolaridad.equals("Escoja:") || nivelEscolaridad.equals("")){
            completo = false;
            mensaje += "-> Debe elegir su Nivel de Escolaridad." + "\n";
        }
        if(vinculo_UV.equals("Escoja:") || vinculo_UV.equals("")){
            completo = false;
            mensaje += "-> Debe elegir su Vínculo con Univalle." + "\n";
        }
        return completo;
    }
    
    public Boolean camposMedioValidos(){
        boolean completo = true;                
        mensaje = "Hay errores en la modificacion de su Perfil:     " + "\n\n";  
        if(jPFContrasena2.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Contraseña está vacío." + "\n";
        } 
        if(completo && !jPFContrasena2.getText().equals(usuario.getContrasena())){
            completo = false;
            mensaje += "-> La contraseña ingresada no es válida." + "\n";
        }             
        if(preguntaSecreta.equals("Escoja:") || preguntaSecreta.equals("")){
            completo = false;
            mensaje += "-> Debe elegir una Pregunta Secreta." + "\n";
        }        
        if(jTFRespuesta1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Respuesta Secreta está vacío." + "\n";
        }
        return completo;
    }
    
    public Boolean camposAbajoValidos(){
        boolean completo = true;                
        mensaje = "Hay errores en la modificación de su Perfil:     " + "\n\n";        
        if(jPFContrasenaActual1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Contraseña está vacío." + "\n";
        }
        if(completo && !jPFContrasenaActual1.getText().equals(usuario.getContrasena())){
            completo = false;
            mensaje += "-> La contraseña ingresada no es válida." + "\n";
        }        
        if(jPFNuevaContrasena1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Nueva Contraseña está vacío." + "\n";
        }
        if(jPFVContrasena1.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Verificaión de Contraseña está vacío." + "\n";
        }
        if(!jPFNuevaContrasena1.getText().equals(jPFVContrasena1.getText())){
            completo = false;
            mensaje += "-> La Contraseña ingresada no es igual a la Verificación." + "\n";
        }      
        return completo;
    }
        
    public void llenarListasDias(){
        //Modelos con los listados de día para los combos de fechas (Dias)
        lista28Dias = new String[29];
        lista28Dias[0]= "Dia:";
        for(int i=1; i<=9; i++)
            lista28Dias[i] = "0"+String.valueOf(i); 
        for(int i=10; i<=28; i++)
            lista28Dias[i] = String.valueOf(i);        
        
        lista30Dias = new String[31];
        lista30Dias[0]= "Dia:";
        for(int i=1; i<=9; i++)
            lista30Dias[i] = "0"+String.valueOf(i); 
        for(int i=10; i<=30; i++)
            lista30Dias[i] = String.valueOf(i); 
        
        lista31Dias = new String[32];
        lista31Dias[0]= "Dia:";
        for(int i=1; i<=9; i++)
            lista31Dias[i] = "0"+String.valueOf(i);
        for(int i=10; i<=31; i++)
            lista31Dias[i] = String.valueOf(i);
    }
    
    public String[] escogerListaDias(String mes){        
        if(mes.equals("02")){
            return lista28Dias;
        }
        if(mes.equals("01") || mes.equals("03") || mes.equals("05") 
                || mes.equals("07") || mes.equals("08") || mes.equals("10") 
                || mes.equals("12")){
            return lista31Dias;
        }
        else
            return lista30Dias;
    }
        
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBAreasInteres;
    private javax.swing.JButton jBCancelar1;
    private javax.swing.JButton jBCancelar2;
    private javax.swing.JButton jBCancelar3;
    private javax.swing.JButton jBGuardar1;
    private javax.swing.JButton jBGuardar2;
    private javax.swing.JButton jBGuardar3;
    private javax.swing.JButton jBModificar1;
    private javax.swing.JButton jBModificar2;
    private javax.swing.JButton jBModificar3;
    private javax.swing.JComboBox jCBAnio1;
    private javax.swing.JComboBox jCBDia1;
    private javax.swing.JComboBox jCBGenero1;
    private javax.swing.JComboBox jCBMes1;
    private javax.swing.JComboBox jCBNivelEscolaridad1;
    private javax.swing.JComboBox jCBPregunta1;
    private javax.swing.JComboBox jCBVinculo1;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JPasswordField jPFContrasena2;
    private javax.swing.JPasswordField jPFContrasenaActual1;
    private javax.swing.JPasswordField jPFNuevaContrasena1;
    private javax.swing.JPasswordField jPFVContrasena1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JTextField jTFApellidos1;
    private javax.swing.JTextField jTFCorreo1;
    private javax.swing.JTextField jTFNombres1;
    private javax.swing.JTextField jTFRespuesta1;
    // End of variables declaration//GEN-END:variables
}
